<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import= "model.*" %>
<%@ page import= "java.util.Iterator" %>
<%         
	UserService userServiceHeader = UserServiceFactory.getUserService();
	String thisURL = request.getRequestURI();
	
%>
<div id="header">
	<a href="../" id="mediaVaultTitle">Media Vault</a>
	<div id="navbar">
		<div class="floatleft">
			<%
 			//MediaType mediaType = MediaType.getMediaType(type);
	 		Iterator<MediaType> types = MediaType.types.iterator(); 
	 		MediaType mtype;
	 		while(types.hasNext()){
	 			mtype = types.next();
 				%><a class="navBarLink" id="navBarLink_<%= mtype.name %>" href="javascript:loadPage('<%= mtype.name %>')"><%= mtype.displayName %></a><%
 			}
			%>
			<a class="navBarLink" id="navBarLink_upload" href="javascript:loadPage('upload')"<% if(request.getRequestURL().toString().contains("/upload.jsp")){%>class="selected"<% } %>>Upload</a>
		</div>
		<div class="floatright">
			<a href="<%= userServiceHeader.createLogoutURL(thisURL)  %>">Logout</a>
		</div>
	</div>
	
 <%-- <H3>Welcome to your Media Vault <%= request.getUserPrincipal().getName() %>. <a href="<%= userService.createLogoutURL(thisURL)  %>">logout</a></H3>
 --%>
</div>